#pragma once
#include "Weapon.h"
#include "ObjectDatabase.h"

class MeleeWeapon : public Weapon {
protected:
	MaterialType m_materialType;
	MeleeWeaponPrefix m_prefix;
	MeleeWeaponSuffix m_suffix;
	void calculateStats(const MeleeWeaponInfo& info, bool defaultsOnly = false);
	bool isEnchanted() const;
public:
	MeleeWeapon(MeleeWeaponType weaponType, MaterialType materialType, MeleeWeaponPrefix prefix = MWP_NONE, MeleeWeaponSuffix suffix = MWS_OF_NONE, bool m_highQuality = false);
	MeleeWeapon(std::ifstream& file);
	~MeleeWeapon();
	void render(float x, float y);
	void logDetails(TextLog& log) const;
	MeleeWeaponPrefix getPrefix() const;
	MeleeWeaponSuffix getSuffix() const;
	GripType getGripType() const;
	int getAccuracy() const;
	int getSpeed() const;
	std::string getItemName(int mod = 0) const;
	void save(std::ofstream& file) const;
};

inline MeleeWeaponPrefix MeleeWeapon::getPrefix() const {return m_prefix;}
inline MeleeWeaponSuffix MeleeWeapon::getSuffix() const {return m_suffix;}
inline GripType MeleeWeapon::getGripType() const {return m_gripType;}
inline int MeleeWeapon::getAccuracy() const {return m_accuracy;}
inline int MeleeWeapon::getSpeed() const {return m_speed;}
